<template>
  <el-dialog v-model="show" :show-close="false" @open="handleOpen" style="margin-top: 3%" class="app-dialog">
    <div class="app-dialog__header">
      <div class="app-dialog__title">{{ title }}</div>
      <el-icon @click="show = false"><Close /></el-icon>
    </div>

    <div class="app-dialog__body">
      <el-scrollbar max-height="63vh">
        <slot></slot>
      </el-scrollbar>
    </div>

    <div class="app-dialog__footer">
      <slot name="footer"></slot>
    </div>
  </el-dialog>
</template>
<script setup>
const show = defineModel({ type: Boolean })

const props = defineProps({
  title: String,
})
</script>
<style lang="scss" scoped>
.app-dialog__header {
  display: flex;
  align-items: center;
  background-color: #f5f5f5;
  line-height: 40px;
  padding: 0 16px;
}

.app-dialog__title {
  flex: 1;
  font-size: 16px;
  font-weight: 600;
}

.app-dialog__body {
  padding: 40px 40px 22px 40px;
}

.app-dialog__footer {
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 40px;
  padding-top: 16px;
}
</style>

<style lang="scss">
.app-dialog {
  padding: 0;
  border-radius: 0;
  overflow: hidden;

  .el-dialog__header {
    display: none;
  }
}
</style>
